IDictionary(TKey, TValue).Add Method

Task Parallel System.Threading

Adds the specified key and value to the IDictionary<(Of <(TKey, TValue>)>).

Namespace:  System.Collections.Concurrent
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Private Sub Add ( _
	key As TKey, _
	value As TValue _
) Implements IDictionary(Of TKey, TValue).Add
C#
void IDictionary<TKey, TValue>.Add(
	TKey key,
	TValue value
)

Parameters

key
Type: TKey
The object to use as the key of the element to add.
value
Type: TValue
The object to use as the value of the element to add.

Implements

IDictionary<(Of <(TKey, TValue>)>)..::.Add(TKey, TValue)

Exceptions

ExceptionCondition
System..::.ArgumentNullExceptionkey is a null reference (Nothing in Visual Basic).
System..::.OverflowExceptionThe dictionary contains too many elements.
System..::.ArgumentException An element with the same key already exists in the ConcurrentDictionary<(Of <(TKey, TValue>)>).

See Also